//
//  Friend.m
//  自定义高度
//
//  Created by 逗比小胖！ on 16/2/29.
//  Copyright © 2016年 徐晨. All rights reserved.
//

#import "Friend.h"
#import "FriendFrame.h"

@implementation Friend

+ (instancetype)friendWithDict:(NSDictionary *)dict{
    return [[self alloc]initWithDict:dict];
}

- (instancetype)initWithDict:(NSDictionary *)dict{
    if(self = [super init]){
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

+ (NSArray *)friendFrameArray {
    NSURL *urlPath = [[NSBundle mainBundle]URLForResource:@"weibo" withExtension:@"plist"];
    NSArray *tempArray = [NSArray arrayWithContentsOfURL:urlPath];
    NSMutableArray *muArray = [NSMutableArray array];
    [tempArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        FriendFrame *friendFrame = [[FriendFrame alloc]init];
        Friend *friend = [Friend friendWithDict:obj];
        
        friendFrame.friend = friend;
        [muArray addObject:friendFrame];
    }];
    //NSLog(@"12345646878%@",muArray);
    return muArray;
    
}





@end
